package utils

import org.apache.spark.{SparkConf, SparkContext}

class WordCount {
  def f(url:String): Boolean = {
    val conf = new SparkConf().setAppName("WordCount").setMaster("local")
    val sc = new SparkContext(conf)
    val rdd = sc.textFile(url);
    rdd.flatMap(_.split("")).map((_, 1)).reduceByKey(_ + _).collect().foreach(println);
    sc.stop();
    return true;
  }



}
